lunomobs:register_mob("lunomobs:chicken", {
	type = "animal",
	hp_max = 2,
	--xp_give = 1,
	textures = {"pet_chicken.png"},
	collisionbox = {-0.2,-0.2,-0.2, 0.2,0.25,0.2}, --padrao
	visual_size= {x=1.2,y=1.2,z=1.2}, --padrao
	--collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
	--visual_size= {x=1.5,y=1.5,z=1.5},
	drawtype="left", --"right"/"left"/"back"/"front"
	visual = "mesh",
	mesh = "pet_chicken.b3d",
	makes_footstep_sound = true,
	walk_velocity = 2,
	armor = 200,
	drops={ 
		{name="lunorecipes:meat_chicken_raw", chance=5, min=1, max=1,},  --chance[1:5] = 20%
		{name="lunorecipes:feather", chance=5, min=1, max=1,},  --chance[1:5] = 20%
		{name="lunorecipes:egg", chance=10, min=1, max=1,}, --chance[1:10] = 10%
		{name="lunorecipes:egg_gold", chance=100, min=1, max=1,}, --chance[1:100] = 01%
	},
	water_damage = 1,
	lava_damage = 10,
	light_damage = 0,
	shadow_damage = 1,
	sounds = {
		random = "pet_chicken_random",
		die = "pet_chicken_die",
	},
	view_range = 5,
	animation = {
		speed_normal = 1,
		stand_start = 1,
		stand_end = 40,
		walk_start = 41,
		walk_end = 81,
	},
	follow = "farming:seed_wheat", --Tipos de comidas que atraem este animal
	--naker_tool = "???????", --Que ferramenta especial extrai algum item deste mob
	--naked_item = "lunorecipes:egg", --Que tipo de item ser extraido deste mob usando ferramenta especial.
	--prop_unnaked = { textures={"pet_chicken.png"}, mesh="pet_chicken.b3d", }, --Aparencia do mob quando [[[NAO]]] extraido um item expecial.
	--prop_naked = { textures={"pet_chicken.png"}, mesh="pet_chicken.b3d", }, --Aparencia do mob quando extraido um item expecial.
	foods = { --Tipos de comidas que domesticam este animal
		"farming:seed_wheat", "farming:seed_cotton", 
	},
	pregnant_delay = 180, --Segundos regressivos para ter filhotes. (Default:300)
	pregnant_drops = { --Item que será dropado se mob estiver gravido.
		{name="lunorecipes:egg_gold", chance=10}, --Chance de 1:10=10%
		{name="lunorecipes:egg", chance=1} --O ultimo a chance e sempre 1:1=100%.)
	}, 
	damage_thief = 7, --Dano em caso alguem tente interagir um pet domesticado que nao lhe pertece.
	--[[
	on_rightclick = function(self, clicker)
		local item = clicker:get_wielded_item()
		if item:get_name() == "farming:seed_wheat" then
			if not minetest.setting_getbool("creative_mode") then
				item:take_item()
				clicker:set_wielded_item(item)
			end
			if self.tamed == nil or not self.tamed then
				self.tamed = true
				self.owner = clicker:get_player_name()
				minetest.chat_send_player(clicker:get_player_name(), "Esta galinha foi domesticada!")
				minetest.sound_play("pet_chicken_random", {pos=self.pos, max_hear_distance = 5})
			elseif self.pregnant_time == nil or self.pregnant_time <= 0 then
				self.pregnant_time = 300 + os.time() --5 minutos para ter filhotes
				minetest.chat_send_player(clicker:get_player_name(), "Esta galinha vai ter filhotes!")
				minetest.sound_play(self.sounds.random, {pos=self.pos, max_hear_distance = self.view_range})
			else
				minetest.sound_play(self.sounds.random, {pos=self.pos, max_hear_distance = self.view_range})
			end
			return
		end
	end,
	]]--

})
--lunomobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, spawn_func)
lunomobs:register_spawn("lunomobs:chicken", {
	"default:dirt", "default:dirt_with_grass", "watershed:grass", 
	"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", 
	"default:dirt_with_snow", "default:snowblock", "default:ice"
}, 20, 8, 5000, 2, 31000)

minetest.register_craftitem("lunomobs:chicken", {
	description = "Galinha",
	groups = { mobs=1 },
	inventory_image = "obj_chicken.png",
	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.above then
			minetest.env:add_entity(pointed_thing.above, "lunomobs:chicken")
			minetest.sound_play("animal_chicken_random_chicken_2", {pos=placer.pos, max_hear_distance = 5}) --toca som "mobs_sheep".ogg a distancia de 5 blocos do usuário.
			if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end
		end
		return itemstack
	end,
})

minetest.register_craft({ --Para o forno funcionar como uma chocadeira
	type = "cooking",
	output = "lunomobs:chicken",
	recipe = "lunorecipes:egg_gold",
	cooktime = 1,
})

minetest.register_alias("chicken"	, "lunomobs:chicken")
minetest.register_alias("galinha"	, "lunomobs:chicken")

